﻿using DocumentFormat.OpenXml.Lite.WordprocessingML.Word.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.WordprocessingML.Word.SectionProperties
{
    [XmlRoot("headerReference", Namespace = Constants.WordMain)]
    public class HeaderReference : XmlSerializable, ISectionPropElement
    {
        [XmlAttribute("id", Namespace = Constants.Relationship, Form = XmlSchemaForm.Qualified)]
        public string RelationshipId { get; set; }

        [XmlAttribute("type", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public ST_HdrFtr Type { get; set; }

        public HeaderReference() { }

        public void Copy(object obj)
        {
            if (obj is HeaderReference)
            {
                this.Type = (obj as HeaderReference).Type;
                this.RelationshipId = (obj as HeaderReference).RelationshipId;
            }
        }
    }
}
